public class ShowletterServlet  extends  HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWrite out = response.getWriterr();
        out.println("<html><body>");
        out.println("<br>小写字母：")
        for (char ch = "a"; ch <= "z"; ch++) {
            out.printf("%-3c", ch);
        }
        out.println("<br>大写字母：")
        for (char ch = "A"; ch <= "Z"; ch++) {
            out.printf("%3c", ch);
        }
        out.println("<html><body>");
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }
}
web.xml
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>ShowLetterServlet</servlet-name>
<servlet-class>com.it.ShowLetterServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ShowLetterServlet</servlet-name>
<servlet-pattern>ShowLetterServlet</url-pattern>
</servlet-mapping>